package com.tool.permission;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;

import com.tool.permission.model.Resource;
import com.tool.permission.service.UserResource;


/**
 * 权限管理
 * @author huff
 *
 */
public class SecurityManager {

	/**
	 * 不要权限的url
	 */
	private List<String> excludes;
	/**
	 * 验证失败页面
	 */
	private String failPage;
	
	@Autowired
	private UserResource userResource;
	
	
	public Object getUserId(HttpServletRequest request) {
		return this.userResource.getUserId(request);
	}
	
	public List<Resource> getUserResources(Object userid,HttpServletRequest request){
		return userResource.getUserResource(userid,request);
	}
	
	public List<String> getExcludes() {
		return excludes;
	}
	public void setExcludes(List<String> excludes) {
		this.excludes = excludes;
	}
	public String getFailPage() {
		return failPage;
	}
	public void setFailPage(String failPage) {
		this.failPage = failPage;
	}
}
